package com.weblog.search.client;

import com.weblog.search.client.factory.CategoryFallBackFactory;
import com.weblog.search.client.impl.CategoryClientImpl;
import com.weblog.search.interceptor.FeignInterceptor;
import entity.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author MaoLin Wang
 * @date 2019/9/2215:37
 */
@FeignClient(value = "weblog-article",fallbackFactory = CategoryFallBackFactory.class,configuration = FeignInterceptor.class)
public interface CategoryClient {

    /**
     * 根据ID查询分类名 (客户端使用)
     *
     * @param id ID
     * @return
     */
    @GetMapping(value = "category/client/{id}")
    Result findCnameById(@PathVariable String id);

    /**
     * 根据id查询分类等级
     *
     * @param cid
     * @return
     */
    @GetMapping("category/client/clevel/{cid}")
    Result getLevelById(@PathVariable("cid") String cid);
}
